﻿using System;
using OpenTK;

namespace GingerGL.Utilities
{
    static public class Matrix
    {
        static public Vector3 GetRight3(Matrix4 matrix) { return matrix.Row0.Xyz; }
        static public Vector4 GetRight4(Matrix4 matrix) { return matrix.Row0; }
        static public Matrix4 SetRight(Matrix4 matrix, Vector3 right) { matrix.Row0.Xyz = right; return matrix; }
        static public Matrix4 SetRight(Matrix4 matrix, Vector4 right) { matrix.Row0 = right; return matrix; }

        static public Vector3 GetUp3(Matrix4 matrix) { return matrix.Row1.Xyz; }
        static public Vector4 GetUp4(Matrix4 matrix) { return matrix.Row1; }
        static public Matrix4 SetUp(Matrix4 matrix, Vector3 up) { matrix.Row1.Xyz = up; return matrix; }
        static public Matrix4 SetUp(Matrix4 matrix, Vector4 up) { matrix.Row1 = up; return matrix; }

        static public Vector3 GetForward3(Matrix4 matrix) { return matrix.Row2.Xyz; }
        static public Vector4 GetForward4(Matrix4 matrix) { return matrix.Row2; }
        static public Matrix4 SetForward(Matrix4 matrix, Vector3 forward) { matrix.Row2.Xyz = forward; return matrix; }
        static public Matrix4 SetForward(Matrix4 matrix, Vector4 forward) { matrix.Row2 = forward; return matrix; }

        static public Vector3 GetTranslation3(Matrix4 matrix) { return matrix.Row3.Xyz; }
        static public Vector4 GetTranslation4(Matrix4 matrix) { return matrix.Row3; }
        static public Matrix4 SetTranslation(Matrix4 matrix, Vector3 translation) { matrix.Row3.Xyz = translation; return matrix; }
        static public Matrix4 SetTranslation(Matrix4 matrix, Vector4 translation) { matrix.Row3 = translation; return matrix; }
    }
}
